package manage.book;

public class BookList {//书架
    private Book[] books = new Book[10];
    private int usedSize;//用来记录当前书架上的书总数

    public BookList(){
        this.books[0] = new Book("三国演义", "罗贯中", 12, "小说");
        this.books[1] = new Book("红楼梦", "曹雪芹", 14, "小说");
        this.books[2] = new Book("水浒传", "施耐庵", 12, "小说");
        this.usedSize = 3;
    }

    public Book getBook(int position){//通过下标返回具体的书
        return books[position];
    }

    public void setBooks(int position, Book book){
        books[position] = book;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

}
